/*********************************************************************
*	Author         : orbit
*	Date           : February 6, 2006
* Last-modified  : October 12, 2006 
*	Contact us     : inte2000@163.com,support@winmsg.com
*	Web Page       : http://www.winmsg.com/cn/orbit.htm (for Chinese version)
*						       http://www.winmsg.com/orbit.htm (for English version)
**********************************************************************/

#ifndef __GLOBALS_H
#define __GLOBALS_H

// size constants
#define TAB_HEIGHT              10   // slack (non text part)
#define TAB_PADDING_X           6
#define TAB_PADDING_Y           4
#define FB_PADDING_X            3
#define FB_PADDING_Y            2

#define TAB_BORDER_HEIGHT       3   // slack (non text part)

// user messages
#define WM_UPDATETABS                          (WM_USER + 0x13)
#define WM_MDI2TABBAR_UPDATEPOSITION           (WM_USER + 0x14)
#define WM_X2TABBAR_UPDATETABS                 (WM_USER + 0x15)
#define WM_SIFRM2TABBAR_FRAMEDESTROY           (WM_USER + 0x16)
#define WM_MDI2TABBAR_CHECKTABCOUNT            (WM_USER + 0x17)
#define WM_MDI2TABBAR_MDIACTIVE                (WM_USER + 0x18)
#define WM_MDI2TABBAR_CHECKROWCOUNT            (WM_USER + 0x19)
#define WM_MDI2TABBAR_UPDATEREBAR              (WM_USER + 0x1A)
#define WM_INSERT_MENU                         (WM_USER + 0x1B)
#define WM_OPSHEET2TABBAR_OPTIONCHANGE         (WM_USER + 0x1C)


// enumerations
enum SnapOrientations           { soTop = 0, soBottom };
enum AddOrder                   { aoFront = 0, aoBack };

extern SnapOrientations cfg_iOrientation;
extern AddOrder cfg_iAddOrder;
extern BOOL cfg_bShowIcons;
extern BOOL cfg_bUseWindowLimit;
extern int cfg_iWindowLimit;

extern BOOL cfg_bUseFBTab;
extern int cfg_iLeftBarWidth;

extern int  g_TabWndMinHeight;
extern int  g_TabWndMinWidth;
extern int g_nSaveTimeSpan;

#define IS_HORIZONTAL(o) ((o) == soTop  ||  (o) == soBottom)

// class declarations
class CSiWindow;
class CTabBarsWnd;
class CSIFrameWnd;
class CSiMDIWnd;

// global variables
extern CSiWindow              *pGlobalActiveSIWindow;
extern CSiMDIWnd              *g_pSiMDIClientWnd;
extern CSIFrameWnd            *g_pSiFrameWnd;  // Source insight main window

extern TCHAR					g_szCurDircetory[MAX_PATH];
extern TCHAR					g_szCurProjectPath[MAX_PATH];

extern void InitGlobalVar();
extern LPCTSTR StrRight(LPCTSTR lpszStr, int n);

LPCTSTR GetAppFilePathName(LPCTSTR lpszFileName, LPTSTR lpBuffer, int nBufferSize = MAX_PATH);

BOOL GetSiProgramLocation(LPTSTR lpBuffer, int nBufSize);
BOOL GetCurrentSiProjectPath(LPTSTR lpBuffer, int nBufSize);

#endif  // __GLOBALS_H
